{#
 This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0. If a copy of the MPL was not distributed with this
 file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "security/base.html" %}

{% block page_title %}{{ advisory.title|striptags }}{% endblock %}

{% block article %}
  <div class="advisory">
    <header>
      <h1 class="mzp-c-article-title">Mozilla Foundation Security Advisory {{ advisory.id }}</h1>
    </header>

    <h2>{{ advisory.title|safe }}</h2>

    <dl class="summary">
      {% if advisory.announced %}
        <dt>Announced</dt>
        <dd>{{ advisory.announced|datetime }}</dd>
      {% endif %}
      {% if advisory.reporter %}
        <dt>Reporter</dt>
        <dd>{{ advisory.reporter|safe }}</dd>
      {% endif %}
      {% if 'risk' in advisory.extra_data %}
        <dt>Risk</dt>
        <dd>{{ advisory.extra_data.risk }}</dd>
      {% endif %}
      {% if advisory.impact %}
        <dt>Impact</dt>
        <dd><span class="level {{ advisory.impact_class }}">{{ advisory.impact }}</span></dd>
      {% endif %}
      <dt>Products</dt>
      <dd>{{ ', '.join(advisory.products) }}</dd>
      <dt>Fixed in</dt>
      <dd>
        <ul>
          {% for prodver in advisory.fixed_in.all() %}
            <li>{{ prodver.name }}</li>
          {% endfor %}
        </ul>
      </dd>
      {% if 'vulnerable' in advisory.extra_data %}
        <dt>Vulnerable</dt>
        <dd>
          <ul>
            {% for prod in advisory.extra_data.vulnerable %}
              <li>{{ prod }}</li>
            {% endfor %}
          </ul>
        </dd>
      {% endif %}
    </dl>

    {{ advisory.html|safe }}

  </div>
{% endblock %}
